package com.gm.commonlib.module.image;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;

import com.github.chrisbanes.photoview.PhotoView;
import com.gm.commonlib.R;
import com.gm.commonlib.views.popupwindow.Popupwindow;

public class ShowBigImageView extends LinearLayout {
    private PhotoView mPhotoView;
    public ShowBigImageView(Context context) {
        super(context);
        initView(context);
    }

    public ShowBigImageView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initView(context);

    }

    private void initView(Context context){
        LayoutInflater.from(context).inflate(R.layout.view_show_big_image,this);
        mPhotoView=findViewById(R.id.photoView);
        findViewById(R.id.closeImage).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Popupwindow.hiddenPop();
            }
        });
    }

    public void show(String path){
       ImageUtil.showImage(mPhotoView,path);
    }


}
